<table class="table table-hover" id="activity-list">
    <tr>
        <th style="border:none;">缩略图</th>
        <th style="border:none;">ID</th>
        <th style="border:none;">标题</th>
        <th style="border:none;">描述</th>
        <th style="border:none;">发布时间</th>
        <th style="border:none;">阅读数量</th>
        <th style="border:none;">参与人数</th>
        <th style="border:none;">结束时间</th>
        <th style="border:none;">状态</th>
        <th style="border:none;">操作</th>
    </tr>
    <?php if($data):?>
        <?php foreach($data as $v):?>
            <tr>
                <td><img src="<?php echo cutUrl($v['thumb'],80,40)?>" alt=""></td>
                <td style="line-height: 40px"><?php echo $v['id']?></td>
                <td style="line-height: 40px"><?php echo str_cut($v['title'],50,'...')?></td>
                <td style="line-height: 40px"><?php echo str_cut($v['description'],50,'...')?></td>
                <td style="line-height: 40px"><?php echo $v['create_time']?></td>
                <td style="line-height: 40px"><?php echo $v['views']?></td>
                <td style="line-height: 40px"><?php echo $v['persons']?></td>
                <td style="line-height: 40px"><?php echo $v['end_time']?></td>
                <td style="line-height: 40px">

                    <?php

                        if(strtotime($v['end_time']) > NOW_TIME) {

                    echo '<span class="green">进行中</span>';

                    } else {

                    echo '<span class="red">已结束</span>';

                    }

                    ?>

                </td>
                <td style="line-height: 40px" data-id="<?php echo $v['id']?>">

                    <a href="javascript:;" class="btn btn-default btn-xs update radius-none">编辑</a>
                    <a href="javascript:;" class="btn btn-success btn-xs show-list radius-none">查看秀图</a>

                </td>
            </tr>
        <?php endforeach;?>
    <?php else:?>
        <tr>
            <td colspan="9" style="text-align: center; font-size: 20px; line-height: 50px">

                没有找到符合条件的数据!

            </td>
        </tr>
    <?php endif;?>
</table>
<div role="group" data-total="<?php echo $total?>" data-page="<?php echo $page?>" data-nums="<?php echo $nums?>" data-src="<?php echo U('Admin/Activity/Index/lists');?>"  class="btn-group" id="_pages"></div>
<script>

    $(function(){

        var options = {

            'status' : '<?php echo $status?>'

        }

        Admin.pages(options);

        //修改
        $('.update','#activity-list').unbind('click');
        $('.update','#activity-list').click(function(){

            var id = $(this).parent().data('id');
            var page = '<?php echo $page?>';

            showMessage('','','<?php echo U("Admin/Activity/Index/update")?>',{'id':id,'page':page});

        })

        //修秀图列表弹出框
        $('.show-list').unbind('click');
        $('.show-list').click(function(){

            var id = $(this).parent().data('id');

            var lay = layer.load();

            $.post('<?php echo U("Admin/Activity/Index/showList")?>',{'id':id},function(result){

                layer.close(lay);

                if(typeof result == 'object' && result.code == 300){

                    showMessage(result.msg,result.code,'','',2000);

                    return false;

                }

                layer.open({

                    type: 1,
                    title: '秀图列表',
                    area: ['100%', '100%'],
                    content: result,

                });

            });



        });


    })

</script>